package org.openweathermap.util;

import vn.com.vtv.R;
import android.content.Context;

public class Language {
	private static Language INSTANCE;
	
	String[] condition_en;
	String[] condition_vi;
	private Language(Context context){
		condition_en = context.getResources().getStringArray(R.array.condition);
		condition_vi = context.getResources().getStringArray(R.array.condition_vi);
	}
	
	public static Language getInstance(Context ctx){
		if(INSTANCE == null) INSTANCE = new Language(ctx);
		return INSTANCE;
	}
	
	public String enToVi(String str){
		for(int i=0;i<condition_en.length;i++){
			if(condition_en[i].compareToIgnoreCase(str) == 0){
				return condition_vi[i];
			}
		}
		return str;
	}
}
